package trabajadores;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author 66880774
 */
 public class Empleado extends Trabajador{
    private float irpf;
    private float salario;
    private float cotss;
    
     public Empleado(String ap1,
                      String ap2,
                      String nif,
                      String nombre,
                      int telefono,
                      Sexo sexo,
                      float irpf,
                      float salario,
                      float cotss)
    {
        super(nif, nombre, ap1, ap2, telefono, sexo);
        this.irpf = irpf;
        this.salario = salario;
        this.cotss = cotss;
    }
     
     
    
    /**
     * @return the irpf
     */
    public float getIrpf() {
        return irpf;
    }

    /**
     * @param irpf the irpf to set
     */
    public void setIrpf(float irpf) {
        this.irpf = irpf;
    }

    /**
     * @return the salario
     */
    public float getSalario() {
        return salario;
    }

    /**
     * @param salario the salario to set
     */
    public void setSalario(float salario) {
        this.salario = salario;
    }
    

    /**
     * @return the cotss
     */
    public float getCotss() {
        return cotss;
    }

    /**
     * @param cotss the cotss to set
     */
    public void setCotss(float cotss) {
        this.cotss = cotss;
    }
    
    
     @Override
    public String toString() {
        return super.toString() + "\n" + "IRPF: " + irpf + "\n" 
                + "SUELDO ANUAL: " + salario + "\n" 
                + "COTIZACION S.S: " + cotss + "\n" + "\n";
    }
     
    @Override
    public float coste()
    {
        return this.getSalario()*(1+this.getIrpf()+this.getCotss());
    }

   @Override
    public void insertardatosespecificos(HSSFCell cell, HSSFRow row){
        cell = row.createCell(5);
        cell.setCellValue(this.getIrpf());
        cell = row.createCell(6);
        cell.setCellValue(this.getSalario());
        cell = row.createCell(7);
        cell.setCellValue(this.getCotss());
    }

    @Override
    public Trabajador clone(){
        return new Empleado(ap1,
                            ap2,
                            nif,
                            nombre,
                            telefono,
                            getSexo(),
                            irpf,
                            salario,
                            cotss);
             }
    }
   
